class LoginAPI:
    def __init__(self):
        self.url_verify = "http://192.168.211.242/index.php?m=Home&c=User&a=verify"
        self.url_login = "http://192.168.211.242/index.php?m=Home&c=User&a=do_login"

    # 获取验证码接口
    def verify(self, session):
        return session.get(self.url_verify)

    # 登陆接口
    def login(self, session, username, password, verify_code):
        login_date = {
            "username": username,
            "password": password,
            "verify_code": verify_code
        }
        return session.post(url=self.url_login, data=login_date)
